package cn.sytton.taffe.web.sys.service.impl;

import cn.sytton.taffe.framework.base.service.BaseService;
import cn.sytton.taffe.web.sys.entity.PositionEntity;
import cn.sytton.taffe.web.sys.mapper.PositionMapper;
import cn.sytton.taffe.web.sys.service.IPositionService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.List;

/**
 * 职位岗位服务层
 *
 * @author skyrock
 */
@Service
@RequiredArgsConstructor
@Transactional(rollbackFor = Exception.class)
public class PositionService extends BaseService<PositionMapper, PositionEntity> implements IPositionService {
    @Override
    public List<PositionEntity> findList() {
        return list(new LambdaQueryWrapper<PositionEntity>().orderByAsc(PositionEntity::getSeq));
    }

    @Override
    public List<PositionEntity> findByIds(String[] ids) {
        return super.listByIds(Arrays.asList(ids));
    }
}
